<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.joda.org/joda/time/tags" prefix="joda"  %>

<!DOCTYPE html>
<html>
<head>
<%@ include file="../../../jsp/commons/headfiles-jquery.jsp"%>
<style type="text/css">
body{
  padding-top:40px;
}
</style>
</head>
<body>
<joda:format var="fireDate" value="${usedate}"/>
<div class="navbar navbar-fixed-top navbar-inverse">
		<div class="navbar-inner">
			<div class="container-fluid">
				<div class="nav-collapse">
					<a class="brand" href="#">${fireDate}各单位军品综合日报</a>
					
    				<button class="btn btn-info" onclick="downloadXls();"><i class="icon-arrow-down"></i>下载EXCEL格式</button>
					<div class="pull-right">
						<button class="btn btn-danger" type="button" onclick="window.close();">
							<i class="icon-remove-sign"></i>关闭
						</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	


	<div class="tabbable tabs-left">
		<ul class="nav nav-tabs">
			<c:forEach items="${beans}" var="bean" varStatus="vs">
				<li><a class="${vs.index==0?"active":""}" data-toggle="tab" href="#d${bean.id}">${bean.department.name}</a></li>
			</c:forEach>

		</ul>
		<div class="tab-content">
		 
			<c:forEach items="${beans}" var="bean" varStatus="vs">
				<div id="d${bean.id}" class="tab-pane ${vs.index==0?"active":""}">
					<table class="table table-condensed table-hover table-bordered">
						<thead>
							<tr>
								<td colspan="5">
								
								日期:${fireDate }
								单位:${bean.department.name}
								</td>
							</tr>
							<tr>
								<th rowspan="2">代码</th>
								<th rowspan="2">名称</th>
								<th colspan="2" class="number-field">期初结存</th>
								<th rowspan="2" class="number-field">本月计划</th>
								<th colspan="2" class="number-field">动工数</th>
								<th colspan="2" class="number-field">合格数</th>
								<th colspan="2" class="number-field">废品数</th>
								<th colspan="2" class="number-field">试销数</th>
								<th rowspan="2" class="number-field">期末数</th>
								<th rowspan="2">备注</th>
								<th rowspan="2">产品类型</th>
							</tr>
							<tr>
								<th>年初</th>
								<th>月初</th>
								<th>当日</th>
								<th>累计</th>
								<th>当日</th>
								<th>累计</th>
								<th>当日</th>
								<th>累计</th>
								<th>当日</th>
								<th>累计</th>
							</tr>
						</thead>
						<tbody>
							<!-- 常规产品 -->
							<tr>
								<td colspan="18" style="background-color: #bbb"><span
									style="color: 000; font-size: 14px; font-weight: bolder">常规产品</span>

								</td>
							</tr>
							<c:set var="armItems" value="${bean.classifiedItems['常规产品']}" />

							<%@ include file="dailyitemList.jsp"%>
							<tr>
								<td colspan="18">&copy;</td>
							</tr>

							<!-- 厂内配套 -->
							<tr>
								<td colspan="18" style="background-color: #bbb"><span
									style="color: 000; font-size: 14px; font-weight: bolder">厂内配套</span>

								</td>
							</tr>
							<c:set var="armItems" value="${bean.classifiedItems['厂内配套']}" />

							<%@ include file="dailyitemList.jsp"%>
														
							<tr>
								<td colspan="18">&copy;</td>
							</tr>

							<!-- 其他 -->
							<tr>
								<td colspan="18" style="background-color: #bbb"><span
									style="color: 000; font-size: 14px; font-weight: bolder">其他 </span>

								</td>
							</tr>
							<c:set var="armItems" value="${bean.classifiedItems['其他 ']}" />

							<%@ include file="dailyitemList.jsp"%>
				
						</tbody>

						<tfoot>

						</tfoot>
					</table>
					
					<table width="100%" id="itemlist"
			class="table table-condensed table-hover table-bordered">
			<caption>
				科研产品及其他产品
			</caption>
     <thead>
        <tr>
         <th>代码</th>
         <th>名称</th>
         <th>年初</th>
         <th>月初</th>
         <th>今日动工</th>
         <th>动工累计</th>
         <th>今日合格</th>
         <th>合格累计</th>
         <th>今日废品</th>
         <th>废品累计</th>
         <th>今日试销</th>
         <th>试销累计</th>
         <th>期末结存</th>
         <th>备注</th>
         <th>类型</th>
        </tr>
     </thead>
     	<c:set var="armItems" value="${bean.researchItems}" />
		<tbody>
		  <%@ include file="researchItemList.jsp"%>
        </tbody>
    </table>
				</div>
			</c:forEach>

		</div>
	</div>
	
	<script type="text/javascript">
	   function downloadXls(){
			var url = "arm-daliy-product-reporter!collate?usedate=${fireDate}";
		   window.open(url,"_blank");
	   }
	</script>
</body>

</html>